package com.example.userservice.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;
import java.util.Map;

@FeignClient(name = "ENROLL-SERVICE")
public interface EnrollClient {
    @PostMapping("/enroll/api/enrollments")
    String createEnrollment(@RequestBody Map<String, Object> requestBody);
    
    @GetMapping("/enroll/api/enrollments/student/{userId}")
    List<Map<String, Object>> getStudentEnrollments(@PathVariable("userId") int userId);
    
    @GetMapping("/enroll/api/enrollments/course/{courseId}")
    List<Map<String, Object>> getCourseEnrollments(@PathVariable("courseId") int courseId);
    
    @PostMapping("/enroll/api/enrollments/approve")
    String approveEnrollment(@RequestBody Map<String, Object> requestBody);
    
    @PostMapping("/enroll/api/enrollments/reject")
    String rejectEnrollment(@RequestBody Map<String, Object> requestBody);
}
